package com.jwm.power.model.reponse;


import com.jwm.power.model.common.EnumResult;

/**
 *
 * @Description: 用来返回统一的格式
 */
public class ResponseData<T> {

    /**
     * 自定义返回码
     */
    private int resultCode;

    /**
     * 返回的信息
     */
    private String msg;

    /**
     * 返回的数据
     */
    private T data;

    public ResponseData() {
        this.resultCode = 0;
        this.msg = "success";
    }

    public ResponseData(int resultCode, String msg, T data) {
        this.resultCode = resultCode;
        this.msg = msg;
        this.data = data;
    }
    public ResponseData(EnumResult enumResult, T data) {
        this.resultCode = enumResult.getCode();
        this.msg = enumResult.getValue();
        this.data = data;
    }

    public int getResultCode() {
        return resultCode;
    }

    public void setResultCode(int resultCode) {
        this.resultCode = resultCode;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
